package com.hotel.sampleTool;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.appengine.api.datastore.Key;
import com.hotel.BL.UserLogic;

import data.User;

public class UserSample extends RequestSampleData {
	public UserSample(HttpServletRequest req,HttpServletResponse resp){
		this.req = req;
		this.resp = resp;
	}
	@Override
	public void CreateSample() {
		CreateSample(1);
	}

	@Override
	public void CreateSample(int iteration) {
		UserLogic userLogic = new UserLogic(req,resp);
		List<User> user = userLogic.GenerateUser(1);
		for(int i=0;i< user.size();i++){
			Key k =datastore.put(user.get(i).getEntity());
			String id = String.valueOf(k.getId());
			if(i >0){
				userLogic.AddUserMapping(1, id,"HouseKeeping");
			}else{
				userLogic.AddUserMapping(1, id,"Front");
			}
			
		}
	}


}
